package A1_4_Shopsystem;

// 现金支付
public class Cash extends Payment {
    private double cashTendered;

    public Cash(double amount, Order order, double cashTendered) {
        super(amount, order);
        this.cashTendered = cashTendered;
    }

    @Override
    public boolean processPayment() {
        // 现金支付逻辑
        System.out.println("Processing cash payment. Amount: " + amount + ", Tendered: " + cashTendered);
        return cashTendered >= amount; // 检查支付金额是否足够
    }

    // Getter 方法
    public double getCashTendered() {
        return cashTendered;
    }
}
